package jobs.xlog;

import com.gzhaoku.xlog.XLog;
import jobs.BaseJob;
import jobs.annotations.JobInfo;
import play.Logger;
import play.Play;
import play.jobs.OnApplicationStart;

/**
 * 启动XLog
 * @author zhangzc
 * @since 2017/8/4
 */
@OnApplicationStart
@JobInfo(name="XLogBoot", desc = "XLog启动程序")
public class XLogBoot extends BaseJob {

    @Override
    public void executeJob() {
        String url = Play.configuration.getProperty("xlog.url", "mock");
        String password  = Play.configuration.getProperty("xlog.password", null);
        Logger.info("XLog: %s", url);
        XLog.setServer(url, password);
        Logger.info("XLog is ready.");
    }
}
